# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper
  def alarm_format(time)
    h time.strftime('%m-%d-%Y %r')
  end
  
  def duration_format(secs)
    time = secs.round
    sec = time % 60
    time /= 60
    mins = time % 60
    time /= 60
    hrs = time % 24
    time /= 24
    days = time
    h "#{days}d#{hrs}h#{mins}m#{sec}s"
  end
end
